import {
  Request
} from '../utils/request.js'

class HttpApi extends Request {
  /* 登录 */
  Login(data) {
    return this.getData({
      url: '/estate/vx/login',
      method: "POST",
      data: data
    })
  }

  /* 退出登录 */
  Logout() {
    return this.getData({
      url: '/estate/vx/logout',
      method: "POST"
    })
  }

  /* 获取验证码 */
  SendVerifyCode(data) {
    return this.getData({
      url: `/estate/vx/sendVerifyCode/${data}`,
      method: "GET"
    })
  }

  /* 获取七牛token */
  GetQiNiuToken() {
    return this.getData({
      url: '/common/getQiNiuToken',
      method: "POST"
    })
  }

  /* 巡逻规范列表 */
  InspectionList() {
    return this.getData({
      url: '/estate/vx/patrolNorm/pageList',
      method: "POST"
    })
  }

  /* 添加巡逻记录 */
  AddPatrolRecord(data) {
    return this.getData({
      url: '/estate/vx/patrolRecord/add',
      method: "POST",
      data: data
    })
  }

  /* 巡逻记录列表 */
  PatrolRecordList(data) {
    return this.getData({
      url: '/estate/vx/patrolRecord/pageList',
      method: "POST",
      data: data
    })
  }

  /* 获取设备类型 */
  DeviceTypeList() {
    return this.getData({
      url: '/estate/vx/device/deviceTypeList',
      method: "GET"
    })
  }

  /* 获取设备列表 */
  DeviceInfoList(data) {
    return this.getData({
      url: `/estate/vx/device/deviceInfoList?deviceTypeId=${data}`,
      method: "GET"
    })
  }

  /* 获取设备详情 */
  GetDeviceInfo(data) {
    return this.getData({
      url: `/estate/vx/device/getDeviceInfoById?deviceId=${data}`,
      method: "GET"
    })
  }

  /* 添加设备 */
  AddDeviceRecord(data) {
    return this.getData({
      url: '/estate/vx/device/saveRecord',
      method: "POST",
      data: data
    })
  }

  /* 维保记录 */
  MaintenanceRecordList(data) {
    return this.getData({
      url: '/estate/vx/device/maintenanceRecordList',
      method: "POST",
      data: data
    })
  }
}

export {
  HttpApi
}